package com.sgcc.statistics.config;

import com.sgcc.statistics.service.ICConsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by jingq on 2021/4/15.
 */
@Component
public class CConsCountTask {

    private Logger logger = LoggerFactory.getLogger(CConsCountTask.class);

    @Autowired
    private ICConsService icConsService;

    // 每年初统计全省的总用户数和各地市的用户数
    @Scheduled(cron = "0 0 1 1 1 ?")
//    @Scheduled(cron = "0 0/2 * * * ?")
    public void execute() {
        logger.info("-----------每年初统计各地市的用户数占比开始---------");
        icConsService.getHushuZb();
    }

    // 每年初统计各地市的总用户数和地区的用户数
    @Scheduled(cron = "0 0 1 1 1 ?")
    public void cityExecute() {
        logger.info("-----------每年初统计各区县的用户数占比开始---------");
        icConsService.getCityHushuZb();
    }

}
